package org.pz.cllient;

import org.pz.entity.UserEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient("user-server")
public interface UserClient {
    /**
     * 根据用户名获取用户信息
     * */
    @RequestMapping("/user/info/findUserInfoByUsername")
    UserEntity findUserInfoByUsername(@RequestParam("username") String username);

    /**
     * 根据资源路径，获取可以访问的角色
     * */
    @RequestMapping("/user/info/findRolesByAsset")
    List<String> findRolesByAsset(@RequestParam("asset") String asset);
}
